//////////////////////////////////////////////////
// EASIM project
// easim.net.DtnNodeInterface
// 6/17/2007 5:48 PM
// Cong Liu
// gzcong@gmail.com

// Copyright (C) 2007
// All rights reserved.
// Refer to LICENSE of JIST (Java In Simulation Time) for terms and conditions of use.

package easim.net;

import jist.swans.misc.Message;
import jist.swans.Constants;
import jist.runtime.JistAPI.DoNotRewrite;

public interface DtnNodeInterface extends DoNotRewrite
{
  public static long JITTER_PER_NEIGHBOR_MIN = 0 * Constants.MILLI_SECOND;
  public static long JITTER_PER_NEIGHBOR_MAX = 20 * Constants.MILLI_SECOND;
  public static long HELLO_INTERVAL_MIN = 100 * Constants.MILLI_SECOND;
  public static long HELLO_INTERVAL_MAX = 300 * Constants.MILLI_SECOND;
  public static long ACK_TIMEOUT = 3 * HELLO_INTERVAL_MAX;
  public static long CONTACT_TIMEOUT = 5 * HELLO_INTERVAL_MAX;

  /// methods to be implemented
  public Message nextMessageToSend();
  public void receiveMessage(Message message, int srcId);
  public void onAckMessage(Message message);
  public void onDropMessage(Message message, int[] dstIds);
  public void onContactDetected(int id);
  public void onContactBroken(int id);

  //////////////////////////////
  // method available to call
  /*/ 
  public void start();
  public void startJitterTimer(); // called when the node has message to send.
  /**/
}
